<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<!-- Skrypt pochodzi z ksiki "101 praktycznych skryptw"  -->
<!-- autor: Marcin Lis    e-mail: 101scripts@marcinlis.com  -->
<SCRIPT LANGUAGE= "JavaScript" type= "text/javascript">
<!-- Ukrycie przed przegldarkami nie obsugujcymi JavaScriptu
var speed = 20;
var speedStep = 1;
var ltop;
var bottom;
var direction = 'down';
var id;
var iter = 4;
function ustaw(){
 if (document.all){
         document.all['ball'].style.left = 0;
         ltop = 0;
         bottom = document.body.clientHeight - 50;
 }
}
y = 0;
x = 0;
function start(){
 x = parseInt(document.all['ball'].style.left);
 document.all['ball'].style.left = ++x;
 y = parseInt(document.all['ball'].style.top);
 if (y < bottom && direction == 'down'){
         y += speedStep++;
         if (y > bottom){
                document.all['ball'].style.top = bottom;
         }
         else{
                document.all['ball'].style.top = y;
         }
         id = setTimeout('start()', speed);
         return;
 }
 else if (y >= bottom && direction == 'down'){
         direction = 'up';
         ltop = ltop + Math.ceil((bottom - ltop) / iter);
         if (ltop >= bottom){
                clearTimeout(id);
                return;
         }
         id = setTimeout('start()', speed);
         return;
 }
 else if (y > ltop && direction == 'up'){
         y -= speedStep--;
         if (y < ltop){
                document.all['ball'].style.top = ltop;
         }
         else{
                document.all['ball'].style.top = y;
         }
         id = setTimeout('start()', speed);
         return;
 }
 else if (y <= ltop && direction == 'up'){
         direction = 'down';
         if (speedStep%3 == 0) speedStep--;
         id = setTimeout('start()', speed);
 }
}
// Koniec kodu JavaScript -->
</SCRIPT>
</HEAD>
<BODY onLoad='ustaw();start();'>
<SCRIPT LANGUAGE= "JavaScript" type= "text/javascript">
<!-- Ukrycie przed przegldarkami nie obsugujcymi JavaScriptu
for (i = 0; i < 1;i++){
 str = '<DIV    ID="ball" ';
 str += 'style = "visibility: visible; ';
 str += 'width=50px; ';
 str += 'heigth=45px; ';
 str += 'position: absolute; ';
 str += 'top: 1; ';
 str += 'left: 1;">';
 str += '<IMG SRC="ball.gif">';
 str += '</DIV>';
 document.write(str);
}
// Koniec kodu JavaScript -->
</SCRIPT>
<H1 align="center">Tre strony<H1>
</BODY>
</HTML>
